home *** CD-ROM | disk | FTP | other *** search
Gui4CLI script | 1999-05-14 | 2.2 KB | 80 lines |
- G4C
-
- ; Clock.gc
- ; ============================================================
- ; This gui works together with the Clock.rexx Arexx script
- ; which is also in this directory - You must also read that
- ; to get the full picture.
-
- ; Note that if you really want to implement one or more clocks
- ; in your guis, you can now use the xTIMER event
- ; ============================================================
-
-
- WINBIG -1 -1 304 26 'ARexx-Gui4Cli Clock'
- BOX 0 0 0 0 out button ; decorative border
-
-
- ; ============================================================
- ; Upon loading, we make sure that rexxmast is available, then
- ; we launch the rexx program that will set our variables and
- ; wake us up every minute, so we can refresh the display.
- ; ============================================================
-
- xOnLoad
-
- ; look for arexx and if not found, launch it..
- ifexists port AREXX
- ; ok..
- else
- cli 'rexxmast'
- wait port AREXX 30
- if $$retcode > 0
- ezreq 'Could not launch RexxMast!' Quit ''
- guiquit clock.gc
- stop
- endif
- endif
-
- ; Look for the Clock.rexx program, in the same directory
-
- extract clock.gc guipath path
- joinfile $path Clock.rexx rexxprog
-
- ; Open the gui and start up the rexx program
-
- GuiOpen Clock.gc
- sendrexx AREXX '$rexxprog clock.gc update'
-
-
- ; ============================================================
- ; On closing the gui, quit. The ARexx program we launched will
- ; quit on it's own when it wakes up and doesn't find us..
- ; ============================================================
-
- xOnClose
- guiquit Clock.gc
-
-
- ; ============================================================
- ; This is the gadget that shows the time, date etc
- ; ============================================================
-
- TEXT 7 5 290 16 "" 100 BOX
- gadfont opal.font 12 000 ; change the font here
- gadtxt center
- gadid 1
-
-
- ; ============================================================
- ; This is the routine that the rexx program we launched will
- ; call every minute, after it has set our variables.
- ; We use it to update the above text gadget.
- ; ============================================================
-
- XRoutine update
- update clock.gc 1 "$time - $day\, $date"
-
-
-
-